package com.mh.server;

/**
 * @author MH
 * @since 2021-10-26
 */
public class HttpProtocolUtil {

    public static String getResponseOk(String body, int length) {
        return "HTTP/1.1 200 OK \n" +
                "Content-Type: text/html \n" +
                "Content-Length: " + length +
                "\n\r\n" +
                body;
    }

    public static String getResponseNotFound() {
        String body = "Not Found";
        return "HTTP/1.1 404 Not Found \n" +
                "Content-Type: text/html \n" +
                "Content-Length: " + body.getBytes().length +
                "\n\r\n" +
                body;
    }
}
